<%@include file="/WEB-INF/pages/commons/commons.jsp"%>

<c:set var="tab" value="BlogDirectories" scope="request"/>

<stripes:layout-render name="/baseMainLayout.jsp" _title="Main" _mainTitle="Recent Entries" _subTitle="Weblog Directory">

    <stripes:layout-component name="_head">${_head}</stripes:layout-component>
    <stripes:layout-component name="_leftHandSideGlobalMenu">${_leftHandSideGlobalMenu}</stripes:layout-component>
    <stripes:layout-component name="_searchInGlobalMenu">
        <stripes:form beanclass="foo.bar.blog.web.action.general.MainActionBean">
                <stripes:text name="searchDirectoryCriteria"/>
                <stripes:submit name="searchDirectories" value="Search Directories"/>
        </stripes:form>
    </stripes:layout-component>
    <stripes:layout-component name="_rightHandSideGlobalMenu">${_rightHandSideGlobalMenu}</stripes:layout-component>
    <stripes:layout-component name="_siteLogo">${_siteLogo}</stripes:layout-component>
    <stripes:layout-component name="_sideBox">${_sideBox}</stripes:layout-component>
    <stripes:layout-component name="_footer">${_footer}</stripes:layout-component>


    <stripes:layout-component name="_content">
        <jsecurity:hasPermission name="mainPortal:viewWeblogDirectories:*">
        <div id="directory">
            <div class="letterMap">
                <p>
                    <!-- A -->
                    <c:choose>
                        <c:when test="${!(actionBean.weblogDirectoryCharacter eq 'A')}">
                            <stripes:link beanclass="foo.bar.blog.web.action.general.MainActionBean" event="viewWeblogDirectories" title="1015 weblogs">
                                <stripes:param name="weblogDirectoryCharacter" value="A"/>
                                A
                            </stripes:link>-
                        </c:when>
                        <c:otherwise>
                            A -
                        </c:otherwise>
                    </c:choose>
                    <!-- B -->
                    <c:choose>
                        <c:when test="${!(actionBean.weblogDirectoryCharacter eq 'B')}">
                            <stripes:link beanclass="foo.bar.blog.web.action.general.MainActionBean" event="viewWeblogDirectories" title="1015 weblogs">
                                <stripes:param name="weblogDirectoryCharacter" value="B"/>
                                B
                            </stripes:link>-
                        </c:when>
                        <c:otherwise>
                            B -
                        </c:otherwise>
                    </c:choose>
                    <!-- C -->
                    <c:choose>
                        <c:when test="${!(actionBean.weblogDirectoryCharacter eq 'C')}">
                            <stripes:link beanclass="foo.bar.blog.web.action.general.MainActionBean" event="viewWeblogDirectories" title="1015 weblogs">
                                <stripes:param name="weblogDirectoryCharacter" value="C"/>
                                C
                            </stripes:link>-
                        </c:when>
                        <c:otherwise>
                            C -
                        </c:otherwise>
                    </c:choose>
                    <!-- D -->
                    <c:choose>
                        <c:when test="${!(actionBean.weblogDirectoryCharacter eq 'D')}">
                            <stripes:link beanclass="foo.bar.blog.web.action.general.MainActionBean" event="viewWeblogDirectories" title="1015 weblogs">
                                <stripes:param name="weblogDirectoryCharacter" value="D"/>
                                D
                            </stripes:link>-
                        </c:when>
                        <c:otherwise>
                            D -
                        </c:otherwise>
                    </c:choose>
                    <!-- E -->
                    <c:choose>
                        <c:when test="${!(actionBean.weblogDirectoryCharacter eq 'E')}">
                            <stripes:link beanclass="foo.bar.blog.web.action.general.MainActionBean" event="viewWeblogDirectories" title="1015 weblogs">
                                <stripes:param name="weblogDirectoryCharacter" value="E"/>
                                E
                            </stripes:link>-
                        </c:when>
                        <c:otherwise>
                            E -
                        </c:otherwise>
                    </c:choose>
                    <!-- F -->
                    <c:choose>
                        <c:when test="${!(actionBean.weblogDirectoryCharacter eq 'F')}">
                            <stripes:link beanclass="foo.bar.blog.web.action.general.MainActionBean" event="viewWeblogDirectories" title="1015 weblogs">
                                <stripes:param name="weblogDirectoryCharacter" value="F"/>
                                F
                            </stripes:link>-
                        </c:when>
                        <c:otherwise>
                            F - 
                        </c:otherwise>
                    </c:choose>
                    <!-- G -->
                    <c:choose>
                        <c:when test="${!(actionBean.weblogDirectoryCharacter eq 'G')}">
                             <stripes:link beanclass="foo.bar.blog.web.action.general.MainActionBean" event="viewWeblogDirectories" title="1015 weblogs">
                                <stripes:param name="weblogDirectoryCharacter" value="\G"/>
                                G
                            </stripes:link>-
                        </c:when>
                        <c:otherwise>
                            G -    
                        </c:otherwise>
                    </c:choose>
                    <!-- H -->
                    <c:choose>
                        <c:when test="${!(actionBean.weblogDirectoryCharacter eq 'H')}">
                            <stripes:link beanclass="foo.bar.blog.web.action.general.MainActionBean" event="viewWeblogDirectories" title="1015 weblogs">
                                <stripes:param name="weblogDirectoryCharacter" value="H"/>
                                H
                            </stripes:link>-
                        </c:when>
                        <c:otherwise>
                            H -
                        </c:otherwise>
                    </c:choose>
                    <!-- I -->
                    <c:choose>
                        <c:when test="${!(actionBean.weblogDirectoryCharacter eq 'I')}">
                            <stripes:link beanclass="foo.bar.blog.web.action.general.MainActionBean" event="viewWeblogDirectories" title="1015 weblogs">
                                <stripes:param name="weblogDirectoryCharacter" value="I"/>
                                I
                            </stripes:link>-
                        </c:when>
                        <c:otherwise>
                            I -
                        </c:otherwise>
                    </c:choose>
                    <!-- J -->
                    <c:choose>
                        <c:when test="${!(actionBean.weblogDirectoryCharacter eq 'J')}">
                            <stripes:link beanclass="foo.bar.blog.web.action.general.MainActionBean" event="viewWeblogDirectories" title="1015 weblogs">
                                <stripes:param name="weblogDirectoryCharacter" value="J"/>
                                J
                            </stripes:link>-
                        </c:when>
                        <c:otherwise>
                            J -
                        </c:otherwise>
                    </c:choose>
                    <!-- K -->
                    <c:choose>
                        <c:when test="${!(actionBean.weblogDirectoryCharacter eq 'K')}">
                            <stripes:link beanclass="foo.bar.blog.web.action.general.MainActionBean" event="viewWeblogDirectories" title="1015 weblogs">
                                <stripes:param name="weblogDirectoryCharacter" value="K"/>
                                K
                            </stripes:link>-
                        </c:when>
                        <c:otherwise>
                            K -
                        </c:otherwise>
                    </c:choose>
                    <!-- L -->
                    <c:choose>
                        <c:when test="${!(actionBean.weblogDirectoryCharacter eq 'L')}">
                            <stripes:link beanclass="foo.bar.blog.web.action.general.MainActionBean" event="viewWeblogDirectories" title="1015 weblogs">
                                <stripes:param name="weblogDirectoryCharacter" value="L"/>
                                L
                            </stripes:link>-
                        </c:when>
                        <c:otherwise>
                            L -
                        </c:otherwise>
                    </c:choose>
                    <!-- M -->
                    <c:choose>
                        <c:when test="${!(actionBean.weblogDirectoryCharacter eq 'M')}">
                            <stripes:link beanclass="foo.bar.blog.web.action.general.MainActionBean" event="viewWeblogDirectories" title="1015 weblogs">
                                <stripes:param name="weblogDirectoryCharacter" value="M"/>
                                M
                            </stripes:link>-
                        </c:when>
                        <c:otherwise>
                            M -
                        </c:otherwise>
                    </c:choose>
                    <!-- N -->
                    <c:choose>
                        <c:when test="${!(actionBean.weblogDirectoryCharacter eq 'N')}">
                            <stripes:link beanclass="foo.bar.blog.web.action.general.MainActionBean" event="viewWeblogDirectories" title="1015 weblogs">
                                <stripes:param name="weblogDirectoryCharacter" value="N"/>
                                N
                            </stripes:link>-
                        </c:when>
                        <c:otherwise>
                            N -
                        </c:otherwise>
                    </c:choose>
                    <!-- O -->
                    <c:choose>
                        <c:when test="${!(actionBean.weblogDirectoryCharacter eq 'O')}">
                            <stripes:link beanclass="foo.bar.blog.web.action.general.MainActionBean" event="viewWeblogDirectories" title="1015 weblogs">
                                <stripes:param name="weblogDirectoryCharacter" value="O"/>
                                O
                            </stripes:link>-
                        </c:when>
                        <c:otherwise>
                            O -
                        </c:otherwise>
                    </c:choose>
                    <!-- P -->
                    <c:choose>
                        <c:when test="${!(actionBean.weblogDirectoryCharacter eq 'P')}">
                            <stripes:link beanclass="foo.bar.blog.web.action.general.MainActionBean" event="viewWeblogDirectories" title="1015 weblogs">
                                <stripes:param name="weblogDirectoryCharacter" value="P"/>
                                P
                            </stripes:link>-
                        </c:when>
                        <c:otherwise>
                            P -
                        </c:otherwise>
                    </c:choose>
                    <!-- Q -->
                    <c:choose>
                        <c:when test="${!(actionBean.weblogDirectoryCharacter eq 'Q')}">
                            <stripes:link beanclass="foo.bar.blog.web.action.general.MainActionBean" event="viewWeblogDirectories" title="1015 weblogs">
                                <stripes:param name="weblogDirectoryCharacter" value="Q"/>
                                Q
                            </stripes:link>-
                        </c:when>
                        <c:otherwise>
                            Q -
                        </c:otherwise>
                    </c:choose>
                    <!-- R -->
                    <c:choose>
                        <c:when test="${!(actionBean.weblogDirectoryCharacter eq 'R')}">
                            <stripes:link beanclass="foo.bar.blog.web.action.general.MainActionBean" event="viewWeblogDirectories" title="1015 weblogs">
                                <stripes:param name="weblogDirectoryCharacter" value="R"/>
                                R
                            </stripes:link>-
                        </c:when>
                        <c:otherwise>
                            R -
                        </c:otherwise>
                    </c:choose>
                    <!-- S -->
                    <c:choose>
                        <c:when test="${!(actionBean.weblogDirectoryCharacter eq 'S')}">
                            <stripes:link beanclass="foo.bar.blog.web.action.general.MainActionBean" event="viewWeblogDirectories" title="1015 weblogs">
                                <stripes:param name="weblogDirectoryCharacter" value="S"/>
                                S
                            </stripes:link>-
                        </c:when>
                        <c:otherwise>
                            S -
                        </c:otherwise>
                    </c:choose>
                    <!-- T -->
                    <c:choose>
                        <c:when test="${!(actionBean.weblogDirectoryCharacter eq 'T')}">
                            <stripes:link beanclass="foo.bar.blog.web.action.general.MainActionBean" event="viewWeblogDirectories" title="1015 weblogs">
                                <stripes:param name="weblogDirectoryCharacter" value="T"/>
                                T
                            </stripes:link>-
                        </c:when>
                        <c:otherwise>
                            T - 
                        </c:otherwise>
                    </c:choose>
                    <!-- U -->
                    <c:choose>
                        <c:when test="${!(actionBean.weblogDirectoryCharacter eq 'U')}">
                            <stripes:link beanclass="foo.bar.blog.web.action.general.MainActionBean" event="viewWeblogDirectories" title="1015 weblogs">
                                <stripes:param name="weblogDirectoryCharacter" value="U"/>
                                U
                            </stripes:link>-
                        </c:when>
                        <c:otherwise>
                            U - 
                        </c:otherwise>
                    </c:choose>
                    <!-- V -->
                    <c:choose>
                        <c:when test="${!(actionBean.weblogDirectoryCharacter eq 'V')}">
                            <stripes:link beanclass="foo.bar.blog.web.action.general.MainActionBean" event="viewWeblogDirectories" title="1015 weblogs">
                                <stripes:param name="weblogDirectoryCharacter" value="V"/>
                                V
                            </stripes:link>-
                        </c:when>
                        <c:otherwise>
                            V - 
                        </c:otherwise>
                    </c:choose>
                    <!-- W -->
                    <c:choose>
                        <c:when test="${!(actionBean.weblogDirectoryCharacter eq 'W')}">
                            <stripes:link beanclass="foo.bar.blog.web.action.general.MainActionBean" event="viewWeblogDirectories" title="1015 weblogs">
                                <stripes:param name="weblogDirectoryCharacter" value="W"/>
                                W
                            </stripes:link>-
                        </c:when>
                        <c:otherwise>
                            W - 
                        </c:otherwise>
                    </c:choose>
                    <!-- X -->
                    <c:choose>
                        <c:when test="${!(actionBean.weblogDirectoryCharacter eq 'X')}">
                            <stripes:link beanclass="foo.bar.blog.web.action.general.MainActionBean" event="viewWeblogDirectories" title="1015 weblogs">
                                <stripes:param name="weblogDirectoryCharacter" value="X"/>
                                X
                            </stripes:link>-
                        </c:when>
                        <c:otherwise>
                            X -
                        </c:otherwise>
                    </c:choose>
                    <!-- Y -->
                    <c:choose>
                        <c:when test="${!(actionBean.weblogDirectoryCharacter eq 'Y')}">
                            <stripes:link beanclass="foo.bar.blog.web.action.general.MainActionBean" event="viewWeblogDirectories" title="1015 weblogs">
                                <stripes:param name="weblogDirectoryCharacter" value="Y"/>
                                Y
                            </stripes:link>-
                        </c:when>
                        <c:otherwise>
                            Y -
                        </c:otherwise>
                    </c:choose>
                    <!-- Z -->
                    <c:choose>
                        <c:when test="${!(actionBean.weblogDirectoryCharacter eq 'Z')}">
                            <stripes:link beanclass="foo.bar.blog.web.action.general.MainActionBean" event="viewWeblogDirectories" title="1015 weblogs">
                                <stripes:param name="weblogDirectoryCharacter" value="Z"/>
                                Z
                            </stripes:link>
                        </c:when>
                        <c:otherwise>
                            Z - 
                        </c:otherwise>
                    </c:choose>
                </p>
            </div>

            <table class="blogdirectory data">
                <thead>
                    <tr>
                        <th scope="col" class="name">Blog Name</th>
                        <th scope="col" class="description">Description</th>
                    </tr>
                </thead>
                <tbody>
                    <c:forEach items="${actionBean.weblogDirectories.list}" var="currentBlog" varStatus="status">
                    <tr>
                        <th scope="row" class="name">
                            <stripes:link beanclass="foo.bar.blog.web.action.general.BlogActionBean" event="view">
                                <stripes:param name="blog" value="${currentBlog.id}"/>
                                <c:out value="${currentBlog.name}"/>
                            </stripes:link>
                        </th>
                        <td class="description">
                            <c:out value="${currentBlog.description}"/>
                        </td>
                    </tr>
                    </c:forEach>
                </tbody>
                <tfoot>
                    <tr class="pagingcontrols">
                        <td class="pagingtext"></td>
                        <td class="paginglinks">
                            <c:if test="${actionBean.weblogDirectories.anyPreviousPage}">
                                <stripes:link beanclass="foo.bar.blog.web.action.general.MainActionBean" event="viewWeblogDirectories">
                                    <stripes:param name="pageNumber" value="${actionBean.weblogDirectories.pageNumber - 1}"/> 
                                    Previous
                                </stripes:link>
                            </c:if>
                            <c:if test="${actionBean.weblogDirectories.anyNextPage}">
                                <stripes:link beanclass="foo.bar.blog.web.action.general.MainActionBean" event="viewWeblogDirectories">
                                    <stripes:param name="pageNumber" value="${actionBean.weblogDirectories.pageNumber + 1}"/>
                                    Next
                                </stripes:link>    
                            </c:if>
                        </td>
                    </tr>
                </tfoot>
            </table>
        </div>
        </jsecurity:hasPermission>
        <jsecurity:lacksPermission name="mainPortal:viewWeblogDirectories:*">
            No "mainPortal:viewWeblogDirectories:*" permission    
        </jsecurity:lacksPermission>
    </stripes:layout-component>

</stripes:layout-render>

